package com.icode.core.model.manage;

import com.icode.core.dto.manager.SellManagerDTO;
import com.icode.core.model.AbstractEntity;
import com.icode.core.model.house.HouseBaseArea;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-8-15
 * Time: 上午10:34
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "sell_manager")
public class SellManager extends AbstractEntity {

    @Column(name = "house_base_area")
    @Enumerated(EnumType.STRING)
    private HouseBaseArea houseBaseArea;

    @Column
    private int gold;
    @Column
    private int busy;
    @Column
    private int slack;
    @Column
    private int common;

    public SellManager() {
    }

    public SellManager(HouseBaseArea houseBaseArea, int gold, int busy, int slack, int common) {
        this.houseBaseArea = houseBaseArea;
        this.gold = gold;
        this.busy = busy;
        this.slack = slack;
        this.common = common;
    }

    public void initSellManager(SellManagerDTO sellManagerDTO) {
        this.gold = Integer.parseInt(sellManagerDTO.getGold());
        this.busy = Integer.parseInt(sellManagerDTO.getBusy());
        this.slack = Integer.parseInt(sellManagerDTO.getSlack());
        this.common = Integer.parseInt(sellManagerDTO.getCommon());
    }

    public void initGold(int gold) {
        this.gold = gold;
    }

    public void initBusy(int busy) {
        this.busy = busy;
    }

    public void initSlack(int slack) {
        this.slack = slack;
    }

    public void initCommon(int common) {
        this.common = common;
    }

    public HouseBaseArea houseBaseArea() {
        return houseBaseArea;
    }

    public int gold() {
        return gold;
    }

    public int busy() {
        return busy;
    }

    public int slack() {
        return slack;
    }

    public int common() {
        return common;
    }
}
